<?php

$cate = new cate();
include_once $config ['client_theme_path'] . $config ['client_theme'] . '/header.php';

$articles = $cate->get_cate_by_title($config['link']);

if ($config['page'] > 1) {
    $config['site_title'] = 'Trang ' . $config['page'] . ' - ' . $articles['name'] . ' - ' . nosignTitle($articles['name']) . ' - BanTinNhaDat.vn';
    $config['site_description'] = 'Trang ' . $config['page'] . ' - ' . $articles['name'] . ' - ' . nosignTitle($articles['name']) . ' - ' . $config['site_description'];
    $config['site_keyword'] = 'Trang ' . $config['page'] . ' - ' . $articles['name'] . ',' . nosignTitle($articles['name']) . ', ' . $config['site_keyword'];
} else {
    $config['site_title'] = $articles['name'] . ' - ' . nosignTitle($articles['name']) . ' - BanTinNhaDat.vn';
    $config['site_description'] = $articles['name'] . ' - ' . nosignTitle($articles['name']) . ' - ' . $config['site_description'];
    $config['site_keyword'] = $articles['name'] . ',' . nosignTitle($articles['name']) . ', ' . $config['site_keyword'];
}

if (isset($articles) && $articles != false) {
    if ($articles['parent_id'] == 0) {
        include_once $config ['client_modules_path'] . '/cate_cap1.php';
    } else {
        include_once $config ['client_modules_path'] . '/cate_cap2.php';
    }
} else {
    header("Location: " . $config['domain']);
}
include_once $config ['client_theme_path'] . $config ['client_theme'] . '/footer.php'; ?>
